package com.zxc.gulimall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zxc.common.to.OrderTo;
import com.zxc.common.to.SkuStockTo;
import com.zxc.common.to.mq.StockLockedTo;
import com.zxc.common.utils.PageUtils;
import com.zxc.gulimall.ware.entity.WareSkuEntity;
import com.zxc.gulimall.ware.vo.OrderVo;
import com.zxc.gulimall.ware.vo.WareLockStockResultVo;
import com.zxc.gulimall.ware.vo.WareSkuLockVo;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author zxc
 * @email 2898743173@qq.com
 * @date 2021-10-27 11:30:02
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addSkuStocks(Long wareId, Long skuId, Integer stock);

    List<SkuStockTo> getSkusHasStock(List<Long> skuIds);

    /*
    * 为某个订单锁定库存
    * */
    Boolean orderLockStock(WareSkuLockVo vo);


    //解锁库存方法
    public void unlockStock(StockLockedTo to);

    public void unlockStock(OrderTo orderTo);
}

